package org.feng.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.feng.base.entity.BaseEntity;
import org.feng.base.enums.ScopeType;

import java.io.Serializable;
import java.time.LocalDate;

/**
 * <p>
 *
 * </p>
 *
 * @author feng
 * @since 2021-08-27
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("sys_user")
public class User extends BaseEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableField("username")
    private String username;

    @TableField("title_img")
    private String titleImg;

    @TableField("password")
    private String password;

    @TableField("nick_name")
    private String nickName;

    @TableField("real_name")
    private String realName;

    @TableField("email")
    private String email;

    @TableField("phone")
    private String phone;

    @TableField("birthday")
    private LocalDate birthday;

    @JsonSerialize(using = ToStringSerializer.class)
    @TableField("sex")
    private Integer sex;

    @TableField("scope_type")
    private ScopeType scopeType;

    @JsonSerialize(using = ToStringSerializer.class)
    @TableField("dept_id")
    private Long deptId;

    @JsonSerialize(using = ToStringSerializer.class)
    @TableField("role_id")
    private Long roleId;

    @JsonSerialize(using = ToStringSerializer.class)
    @TableField("job_id")
    private Long jobId;
}
